﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="ApproveBooking.aspx.vb" Inherits="ExpWeb.ApproveBooking" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <div class="row">
        <div class="col-md-6">
            <h3>Approve Booking</h3>
        </div>
    </div>

    <asp:MultiView ID="MultiView1" runat="server">
        <asp:View ID="view0" runat="server">
            <div class="row" style="margin-bottom: 60px;">
                <div class="col-md-12">
                    <div class="col-md-3">
                        <div class="form-group">
                            <label>Booking ID :</label>
                            <asp:TextBox ID="txtBookIdView0" runat="server" CssClass="form-control"></asp:TextBox>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="form-group">
                            <label>User Name :</label>
                            <asp:TextBox ID="txtUsernameView0" runat="server" CssClass="form-control"></asp:TextBox>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="form-group">
                            <label>First name :</label>
                            <asp:TextBox ID="txtFNameView0" runat="server" CssClass="form-control"></asp:TextBox>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="form-group">
                            <label>Last Name :</label>
                            <asp:TextBox ID="txtLNameView0" runat="server" CssClass="form-control"></asp:TextBox>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="form-group has-feedback">
                            <label>Check in date :</label>
                            <asp:TextBox ID="txtCheckinDateView0" runat="server" CssClass="form-control"></asp:TextBox>
                            <span class="glyphicon glyphicon-calendar form-control-feedback" aria-hidden="true"></span>
                            <ajax:CalendarExtender ID="cldCheckinDateView0" runat="server" TargetControlID="txtCheckinDateView0" Format="dd MMM yyyy"></ajax:CalendarExtender>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="form-group has-feedback">
                            <label>Check out date :</label>
                            <asp:TextBox ID="txtCheckoutDateView0" runat="server" CssClass="form-control"></asp:TextBox>
                            <span class="glyphicon glyphicon-calendar form-control-feedback" aria-hidden="true"></span>
                            <ajax:CalendarExtender ID="cldCheckoutDateView0" runat="server" TargetControlID="txtCheckoutDateView0" Format="dd MMM yyyy"></ajax:CalendarExtender>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="form-group">
                            <label>Country :</label>
                            <asp:DropDownList ID="ddlCountryView0" runat="server" CssClass="form-control" AppendDataBoundItems="true">
                                <asp:ListItem Text="" Value=""></asp:ListItem>
                            </asp:DropDownList>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="form-group">
                            <label>Brand :</label>
                            <asp:DropDownList ID="ddlBrandView0" runat="server" CssClass="form-control" AppendDataBoundItems="true">
                                <asp:ListItem Text="" Value=""></asp:ListItem>
                            </asp:DropDownList>
                            </div>
                    </div>
                    <div class="col-md-3">
                        <div class="form-group">
                            <label>Resort :</label>
                            <asp:DropDownList ID="ddlResortView0" runat="server" CssClass="form-control" AppendDataBoundItems="true">
                                <asp:ListItem Text="" Value=""></asp:ListItem>
                            </asp:DropDownList>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="form-group">
                            <label>Location :</label>
                            <asp:TextBox ID="txtLocationView0" runat="server" CssClass="form-control"></asp:TextBox>
                        </div>
                    </div>
                    <div class="col-md-3">
                                <div class="form-group">
                                    <label>Status :</label>
                                    <asp:DropDownList ID="ddl_StatusSearch" runat="server" CssClass="form-control">
                                        <asp:ListItem Value=""></asp:ListItem>
                                        <asp:ListItem Value="REQUEST">REQUEST</asp:ListItem>
                                        <asp:ListItem Value="APPROVE">APPROVE</asp:ListItem>
                                        <asp:ListItem Value="REJECT">REJECT</asp:ListItem>
                                    </asp:DropDownList>    
                                </div>
                    </div>
                    <div class="col-md-12 text-center">
                        <asp:LinkButton ID="btn_search" runat="server" OnClick="btnSearch_Click" CssClass="btn btn-default"><span class="glyphicon glyphicon-search"></span> Search</asp:LinkButton>
                        <asp:LinkButton ID="btn_Clear" runat="server" OnClick="btnClear_Click" CssClass="btn btn-default"><span class="glyphicon glyphicon-refresh"></span> Clear</asp:LinkButton>
                        <asp:Button ID="btnSearchView0" runat="server" Text="Search" CssClass="btn btn-default" Visible="false"   />
                    </div>
                </div>
            </div>

            <div class="row" style="margin-bottom: 60px;">
                <div class="col-md-12">
                    <asp:GridView ID="grdView0" runat="server" DataKeyNames="Booking_ID" Width="100%" AutoGenerateColumns="False" 
                        CssClass="table table-hover" GridLines="None" ShowHeaderWhenEmpty="true" AllowSorting="True">
                          <HeaderStyle ForeColor="White" Font-Bold="True" BackColor="#6B696B"></HeaderStyle>
                         <Columns>
                            <asp:TemplateField HeaderText="">
                                <ItemStyle VerticalAlign="top" HorizontalAlign="Center" />
                                <HeaderTemplate>
                                    <center></center>
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:LinkButton runat="server" ToolTip="Approve" CommandName="Approve" CommandArgument='<%#Eval("Booking_ID")%>' ID="lnkApprove">
                                <span class="glyphicon glyphicon-check" aria-hidden="true"></span>
                                    </asp:LinkButton>
                                    <asp:LinkButton runat="server" ToolTip="More detail" CommandName="Detail" CommandArgument='<%#Eval("Booking_ID")%>' ID="lnkDetail">
                                <span class=" glyphicon glyphicon-list-alt" aria-hidden="true"></span>
                                    </asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>

                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <center>Booking ID</center>
                                </HeaderTemplate>
                                <ItemStyle VerticalAlign="top" HorizontalAlign="Center" />
                                <ItemTemplate><%# Eval("Booking_ID")%></ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <center>Resort Name</center>
                                </HeaderTemplate>
                                <ItemStyle VerticalAlign="top" HorizontalAlign="Left" />
                                <ItemTemplate><%# Eval("ResortName")%></ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <center>Unit Number</center>
                                </HeaderTemplate>
                                <ItemStyle VerticalAlign="top" HorizontalAlign="Left" />
                                <ItemTemplate><%# Eval("UnitName")%></ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <center>Currency</center>
                                </HeaderTemplate>
                                <ItemStyle VerticalAlign="top" HorizontalAlign="left" />
                                <ItemTemplate><%# Eval("Currency_Name")%></ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <center>Rate (/Night)</center>
                                </HeaderTemplate>
                                <ItemStyle VerticalAlign="top" HorizontalAlign="left" />
                                <ItemTemplate><%# CInt(Eval("RatePrice")).ToString("#,###")%></ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <center>Pool Point</center>
                                </HeaderTemplate>
                                <ItemStyle VerticalAlign="top" HorizontalAlign="center" />
                                <ItemTemplate><%# CInt(Eval("PointPerNight")).ToString("#,###")%></ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <center>Night</center>
                                </HeaderTemplate>
                                <ItemStyle VerticalAlign="top" HorizontalAlign="center" />
                                <ItemTemplate><%# Eval("Night")%></ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <center>Country</center>
                                </HeaderTemplate>
                                <ItemStyle VerticalAlign="top" HorizontalAlign="center" />
                                <ItemTemplate><%# Eval("CountryName")%></ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <center>Status</center>
                                </HeaderTemplate>
                                <ItemStyle VerticalAlign="top" HorizontalAlign="left" />
                                <ItemTemplate>
                                    <center><%# Eval("status")%></center>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <EmptyDataTemplate>
                            <h4 class="text-center text-danger">No data found.</h4>
                        </EmptyDataTemplate>
                    </asp:GridView>
                </div>
            </div>
        </asp:View>
        <asp:View ID="view1" runat="server">

            <div class="row">

                <div class="col-md-6">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            Booking Info
                        </div>
                        <div class="panel-body">
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label>Booking ID :</label>
                                    <asp:Label ID="lblBookIDView1" runat="server" CssClass="form-control-static" Text="-"></asp:Label>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label>Resort Name :</label>
                                    <asp:Label ID="lblResortNameView1" runat="server" CssClass="form-control-static"></asp:Label>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label>Unit Number :</label>
                                    <asp:Label ID="lblUnitNoView1" runat="server" CssClass="form-control-static"></asp:Label>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label>Currency :</label>
                                    <asp:Label ID="lblCurrencyView1" runat="server" CssClass="form-control-static" Text="0"></asp:Label>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label>Rate (/Night)</label>
                                    <asp:Label ID="lblRateView1" runat="server" CssClass="form-control-static" Text="0"></asp:Label>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label>Pool Point</label>
                                    <asp:Label ID="lblPoolPointView1" runat="server" CssClass="form-control-static" Text="0"></asp:Label>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label>Night</label>
                                    <asp:Label ID="lblNightView1" runat="server" CssClass="form-control-static" Text="0"></asp:Label>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label>Country</label>
                                    <asp:Label ID="lblCountryView1" runat="server" CssClass="form-control-static" Text="0"></asp:Label>
                                </div>
                            </div>
                        </div>
                        <div class="panel-footer">
                        </div>
                    </div>
                </div>

                <div class="col-md-6">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            User Info
                        </div>
                        <div class="panel-body">

                            <div class="col-md-6">
                                <div class="form-group">
                                    <label>First Name :</label>
                                    <asp:Label ID="lblFNameView1" runat="server" CssClass="form-control-static"></asp:Label>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label>Last Name : </label>
                                    <asp:Label ID="lblLNameView1" runat="server" CssClass="form-control-static"></asp:Label>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label>Phone :</label>
                                    <asp:Label ID="lblPhoneView1" runat="server" CssClass="form-control-static"></asp:Label>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label>Mobile :</label>
                                    <asp:Label ID="lblMobileView1" runat="server" CssClass="form-control-static"></asp:Label>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label>Email :</label>
                                    <asp:Label ID="lblEmailView1" runat="server" CssClass="form-control-static"></asp:Label>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label>Join Date:</label>
                                    <asp:Label ID="lblJoinDate" runat="server" CssClass="form-control-static"></asp:Label>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label>Expire Date :</label>
                                    <asp:Label ID="lblExpireDate" runat="server" CssClass="form-control-static"></asp:Label>
                                </div>
                            </div>
                        </div>
                        <div class="panel-footer">
                        </div>
                    </div>
                </div>

            </div>

            <div class="row" style="margin-bottom:60px;">
                <div class="col-md-4 col-md-offset-4">

                    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                        <ContentTemplate>
                    <div class="form-group">
                        <label>Booking Status :</label>
                        <asp:DropDownList ID="ddlStatus" runat="server" CssClass="form-control" OnSelectedIndexChanged="ddlStatus_SelectedIndexChanged" AutoPostBack="true">
                            <asp:ListItem Text="Approved" Value="APPROVED"></asp:ListItem>
                            <asp:ListItem Text="Reject"  Value="REJECT"></asp:ListItem>
                        </asp:DropDownList>
                    </div>

                    <div class="form-group" id="divReject" runat="server" visible="false">
                        <label>Reject Reason :</label>
                        <asp:TextBox ID="txtRejectReason" runat="server" TextMode="MultiLine" Rows="3" CssClass="form-control" placeholder="Why reject?" ValidationGroup="Reason"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="rqRejectReason" runat="server" ErrorMessage="Please enter reject reason." Display="Dynamic" ControlToValidate="txtRejectReason" ValidationGroup="Reason" CssClass="text-danger" Enabled="false"></asp:RequiredFieldValidator>
                    </div>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                    <div class="col-md-12 text-center">
                        <asp:Button ID="BtnUpdateStatus" runat="server" Text="Update Status" CssClass="btn btn-default" ValidationGroup="Reason" OnClick="BtnUpdateStatus_Click" OnClientClick="return confirm('Make sure to approve this request?');" />
                        <asp:Button ID="btnBack" runat="server" Text="Back" CssClass="btn btn-default" OnClick="btnBack_Click" />
                    </div>

                </div>

            </div>

            <asp:HiddenField ID="hdfBookID" runat="server" />

        </asp:View>

    </asp:MultiView>
</asp:Content>

<asp:Content ContentPlaceHolderID="script" runat="server">
    <script type="text/javascript">
        ActiveMenuIndex(1);
    </script>
</asp:Content>
